<?php

class App_Methods_Request_HideApp {

  /**
   *
   * @var App_Methods_Data_App
   */
  public $app;
  public $applicationId;

  public function __construct($params) {
    $this->app = new App_Methods_Data_App($params->app);
    $this->applicationId = $params->applicationId;
  }

  public function process() {
  	$userPulpit = UserPulpitQuery::create()->findPk(array(Core_Auth::getInstance()->getUser()->getId(), $this->applicationId));
  	if (!$userPulpit instanceof UserPulpit) {
  		$userPulpit = new UserPulpit();
  		$userPulpit->setDefaultData();
  	}
  	$userPulpit->setVisible(0);
  	$userPulpit->save();
    return new App_Methods_Response_SaveOrder(true);
  }

}